﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Models;

namespace Workflow
{
    public partial class SearchBug : System.Web.UI.Page
    {
        private WorkflowManager objWorkflowManager = new WorkflowManager();
        private BugManager objBugManager = new BugManager();
        public List<BugClass> resultList = new List<BugClass>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                try
                {
                    this.ddlNodeName.DataSource = objWorkflowManager.GetNodeName(3);
                    this.ddlNodeName.DataBind();
                }
                catch (Exception ex)
                {
                    string msg = string.Format("<script>alert('{0}')</script>", ex.Message);
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", msg);
                }
            }
            
        }

        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                resultList = objBugManager.GetAllBugInfo(this.ddlNodeName.SelectedValue,this.ddlPName.SelectedValue,this.ddlMName.SelectedValue);
            }
            catch (Exception ex)
            {
                string msg = string.Format("<script>alert('{0}')</script>", ex.Message);
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", msg);
            }

            
        }
    }
}